package listener_pattern;

import java.util.Observable;
import java.util.Observer;

/**
 * @ClassName:
 * @Description: 监听器相当于观察者即矮大紧
 * @Author: LynnZou
 * @Date: 2017/6/16
 */
public class Listener implements Observer {

    private String name;

    public Listener(String name) {
        this.name = name;
    }

    public void update(Observable o, Object arg) {
        System.out.println(String.format("%s收到新杂志%s",name,arg));
    }
}
